package com.towin.org.esdemo.controller;

import com.towin.org.esdemo.controller.vo.SystemHelpCenterCreateVO;
import com.towin.org.esdemo.es.entity.SystemHelpCenterDTO;
import com.towin.org.esdemo.service.SystemHelpCenterService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wzx
 * @date 2025/6/6 9:50
 * @description: SystemHelpController
 */

@RestController
@RequestMapping("/api/system-help")
public class SystemHelpController {

    @Resource
    private SystemHelpCenterService systemHelpCenterService;


    @RequestMapping("/create")
    public String create(@RequestBody SystemHelpCenterCreateVO systemHelpCenterCreateVO) {
        systemHelpCenterService.create(systemHelpCenterCreateVO);
        return "success";
    }


    @GetMapping("/list-by-keyword")
    public List<SystemHelpCenterDTO> listByKeyword(@RequestParam("keyword") String keyword) {
        return systemHelpCenterService.listByKeyword(keyword);
    }

}
